package MyOop04;

import java.util.Scanner;

/**
 * 身份证号信息查看
 */
public class StringDemo008 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你的身份证号：");
        String id = scanner.next();
        String nian = id.substring(6,10);
        String yue = id.substring(10,12);
        String ri = id.substring(12,14);
        System.out.println("出生于"+nian+"年"+yue+"月"+ri+"日");
        char gender = id.charAt(id.length()-2);
        System.out.println(gender);
        int num = gender-48;
        System.out.println(num);
       if (num%2==0){
           System.out.println("性别为女");
       }else {
           System.out.println("性别为男");
       }
    }
}
